Skip to content

fix(server): fail V2 turns when the OpenCode event stream ends - #9905

Merged
juliusmarminge merged 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:fix/v2-opencode-eof-20260905
Sep 10, 2026
Merged

fix(server): fail V2 turns when the OpenCode event stream ends#9905
juliusmarminge merged 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:fix/v2-opencode-eof-20260905

Conversation

@saphid

@saphid saphid commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

After OpenCode's event stream ends, reject new turns and prevent a racing compaction response from reporting success. End the adapter event queue after delivering the transport failure so consumers can reconnect.

Rebased the remaining changes onto v2, which already fails active turns on EOF. Preserved current descendant cleanup and normal shutdown handling.

Validation: all three added EOF/race tests hang on the base (bounded to 2 seconds for the negative run); all 40 OpenCode adapter tests pass with the fix. Scoped formatting/lint and server typechecking pass. CI and Claude Fable 5.1 review are checked before merge.

Prepared with Codex/T3 from the original contribution; independent review requested from Claude Fable 5.1.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 5, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 49d5625

Macroscope's review found this PR approvable — This is a small, self-contained OpenCode EOF bug fix that terminates active turns consistently, blocks invalid follow-up work, and adds targeted race-condition coverage. It does not alter healthy-path behavior, schemas, product defaults, or static-analysis configuration.

You can add or adjust custom eligibility rules. Learn more.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Sep 5, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ed8886de32e7b7877eed2b52eb80daddf5e46484. Configure here.

Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 5, 2026
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from b82facd to 2ac9bfe Compare September 5, 2026 04:56
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 5, 2026
@saphid
saphid force-pushed the fix/v2-opencode-eof-20260905 branch from 9f4f5e0 to 8d4d71b Compare September 5, 2026 05:09

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All clear

Posted via Macroscope — Effect Service Conventions

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 3 times, most recently from efd9994 to 6102d00 Compare September 8, 2026 06:23
@saphid
saphid force-pushed the fix/v2-opencode-eof-20260905 branch from f134f08 to 02f7c19 Compare September 9, 2026 00:26
@cursor

cursor Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@macroscopeapp
macroscopeapp Bot dismissed their stale review September 9, 2026 00:26

Dismissing prior approval to re-evaluate 02f7c19

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All clear

Posted via Macroscope — Effect Service Conventions

@macroscopeapp

macroscopeapp Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

All clear

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts Outdated
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 9, 2026
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from ed5dc41 to 2b1139a Compare September 10, 2026 19:28
@juliusmarminge
juliusmarminge force-pushed the fix/v2-opencode-eof-20260905 branch from 1b78928 to 49d5625 Compare September 10, 2026 23:33
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 10, 2026 23:33

Dismissing prior approval to re-evaluate 49d5625

@juliusmarminge
juliusmarminge merged commit 209fe68 into pingdotgg:t3code/codex-turn-mapping Sep 10, 2026
24 checks passed
juliusmarminge pushed a commit that referenced this pull request Sep 11, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
juliusmarminge pushed a commit that referenced this pull request Sep 11, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
juliusmarminge pushed a commit that referenced this pull request Sep 11, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants